package cn.bugstack.domain.activity.service.trial.factory;

import cn.bugstack.domain.activity.model.entity.MarketProductEntity;
import cn.bugstack.domain.activity.model.entity.TrialBalanceEntity;
import cn.bugstack.domain.activity.model.valobj.GroupBuyActivityDiscountVO;
import cn.bugstack.domain.activity.model.valobj.SkuVO;
import cn.bugstack.domain.activity.service.trial.node.RootNode;
import cn.bugstack.types.design.framework.tree.StrategyHandler;
import java.math.BigDecimal;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * @author hsj
 * @date 2025/2/12 10:41
 */
@Service
public class DefaultActivityStrategyFactory {


	private final RootNode rootNode;

	public DefaultActivityStrategyFactory(RootNode rootNode) {
		this.rootNode = rootNode;
	}

	public StrategyHandler<MarketProductEntity,DynamicContext, TrialBalanceEntity> strategyHandler(){
		return rootNode;
	}

	@Data
	@Builder
	@AllArgsConstructor
	@NoArgsConstructor
	public static class DynamicContext{
		// 拼团活动营销配置值对象
		private GroupBuyActivityDiscountVO groupBuyActivityDiscountVO;
		// 商品信息
		private SkuVO skuVO;
		// 折扣金额
		private BigDecimal deductionPrice;
		// 支付金额
		private BigDecimal payPrice;
		// 活动可见性限制
		private boolean visible;
		// 活动
		private boolean enable;


	}


}
